package com.jifeng.br.pjj.bookreader.controller.admin;

import com.jifeng.br.pjj.bookreader.entity.UserinfoEntity;
import org.apache.shiro.SecurityUtils;

/**
 * @Author PangJunjie
 * @Date 2023/7/12/012
 */
public abstract class BaseController {
    protected UserinfoEntity getUser() {
        return (UserinfoEntity) SecurityUtils.getSubject().getPrincipal();
    }

    protected Integer getUserId() {
        return getUser() == null ? null : getUser().getUserId();
    }
}
